<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('库存统计列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>仓库：</label>
                                <select id="warehouseId" name="warehouseId" style="width: 200px">
                                    <option value="01">托盘库</option>
                                    <option value="02">料箱库</option>
                                </select>
                            </li>
                            <li>
                                <label>物料编码：</label>
                                <input type="text" name="productId"/>
                            </li>
                            <li>
                                <label>物料名称：</label>
                                <input type="text" name="productName"/>
                            </li>
                            <li>
                                <label>比例号：</label>
                                <input type="text" name="sizeNo"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('formId','bootstrap-table')"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('formId','bootstrap-table')"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="search:statistics:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-bordered">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('search:statistics:edit')}]];
        var removeFlag = [[${@permission.hasPermi('search:statistics:remove')}]];
        var prefix = ctx + "search/statistics";
        var warehouseId = [[${@dict.getType('is_house')}]];

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "库存统计",
                pageSize: 10,
                pageList: [10, 25, 50],
                clickToSelect: true,//是否启用点击选中行
                uniqueId:"warehouseId",//表主键(用于修改和删除)
                sortName:"warehouseId",//必加排序 sortOrder: "asc"默认
                columns: [
                {
                    field: 'warehousecode',
                    title: '',
                    halign: 'center',
                    align:'center',
                },
                {
                    field: 'warehouseId',
                    title: '仓库',
                    halign: 'center',
                    align:'center',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(warehouseId, value);
                    }
                },
                {
                    field: 'productId',
                    title: '物料编码',
                    halign: 'center',
                    align:'center'
                },
                {
                    field: 'productName',
                    title: '物料名称',
                    halign: 'center',
                    align:'center'
                },
                {
                    field: 'sizeNo',
                    title: '比例号',
                    halign: 'center',
                    align:'center'
                },
                {
                    field: 'quantity',
                    title: '数量',
                    halign: 'center',
                    align:'center'
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>